﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace FPC.Offer.UI.GeneralProcessor.SkyDriveHand
{
    /// <summary>
    /// DelSubHandler 的摘要说明
    /// </summary>
    public class DelSubHandler : IHttpHandler
    {
        FPC.Offer.Service.System_SubfolderTableService Sky = new Service.System_SubfolderTableService();
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            var id = Convert.ToInt32(context.Request["id"]);
            Model.Subfolder c = Sky.Find(w => w.SId == id).FirstOrDefault();
            var dd = c.NetState;
            if (dd == 1)
            {
                c.NetState = 2;
            }
            else if (dd == 2)
            {
                c.NetState = 1;
            }



            int a = Sky.Update(c);
            if (a > 0)
            {
                context.Response.Write(1);

            }
            else
            {

                context.Response.Write(0);
            }


        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}